home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / tcl / tcl70b2.lha / tcl7.0b2 / doc / tclsh.1 < prev    next >
Text File  |  1993-06-07  |  3KB  |  76 lines

  1. '\"
  2. '\" Copyright (c) 1993 The Regents of the University of California.
  3. '\" All rights reserved.
  4. '\"
  5. '\" Permission is hereby granted, without written agreement and without
  6. '\" license or royalty fees, to use, copy, modify, and distribute this
  7. '\" documentation for any purpose, provided that the above copyright
  8. '\" notice and the following two paragraphs appear in all copies.
  9. '\"
  10. '\" IN NO EVENT SHALL THE UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY
  11. '\" FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
  12. '\" ARISING OUT OF THE USE OF THIS DOCUMENTATION, EVEN IF THE UNIVERSITY OF
  13. '\" CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  14. '\"
  15. '\" THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY WARRANTIES,
  16. '\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
  17. '\" AND FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
  18. '\" ON AN "AS IS" BASIS, AND THE UNIVERSITY OF CALIFORNIA HAS NO OBLIGATION TO
  19. '\" PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
  20. '\" 
  21. '\" $Header: /user6/ouster/tcl/man/RCS/tclsh.1,v 1.1 93/06/07 15:31:32 ouster Exp $ SPRITE (Berkeley)
  22. '/" 
  23. .so man.macros
  24. .HS tclsh tclcmds
  25. .BS
  26. '\" Note:  do not modify the .SH NAME line immediately below!
  27. .SH NAME
  28. tclsh \- Simple shell containing Tcl interpreter
  29. .SH SYNOPSIS
  30. \fBtclsh\fR ?\fIfileName arg arg ...\fR?\fR
  31. .BE
  32.  
  33. .SH DESCRIPTION
  34. .PP
  35. \fBTclsh\fR is a shell-like application that reads Tcl commands
  36. from its standard input or from a file and evaluates them.
  37. If invoked with no arguments then it runs interactively, reading
  38. Tcl commands from standard input and printing command results and
  39. error messages to standard output.
  40. It runs until the \fBexit\fR command is invoked or until it
  41. reaches end-of-file on its standard input.
  42. .PP
  43. If \fBtclsh\fR is invoked with arguments then the first argument
  44. is the name of a script file and the other arguments (if any)
  45. are made available to the script to use in any way that it wishes.
  46. Instead of reading commands from standard input \fBtclsh\fR will
  47. read Tcl commands from the named file;  \fBtclsh\fR will exit
  48. when it reaches the end of the file.
  49. .PP
  50. \fBTclsh\fR sets the following Tcl variables to describe its
  51. command-line arguments:
  52. .TP
  53. \fBargc\fR
  54. Contains a count of the number of \fIarg\fR arguments (0 if none).
  55. .TP
  56. \fBargv\fR
  57. Contains a Tcl list whose elements are the \fIarg\fR arguments,
  58. in order, or an empty string if there are no \fIarg\fR arguments.
  59. .TP
  60. \fBargv0\fR
  61. Contains \fIfileName\fR if it was specified.
  62. Otherwise, contains the name by which \fBtclsh\fR was invoked.
  63. .PP
  64. If you create a Tcl script in a file whose first line is
  65. .DS
  66. \fB#!/usr/local/bin/tclsh
  67. .DE
  68. then you can invoke the script file directly from your shell if
  69. you mark it as executable.
  70. This assumes that \fBtclsh\fR has been installed in the default
  71. location in /usr/local/bin;  if it's installed somewhere else
  72. then you'll have to modify the above line to match.
  73.  
  74. .SH KEYWORDS
  75. interpreter, script file, shell
  76.